<%@page import="javax.portlet.ResourceURL"%>
<%@ include file="/WEB-INF/jsp/init.jsp" %>
<%@ taglib prefix="portlet" uri="http://java.sun.com/portlet" %>


<h1>Welcome to our library</h1>

<portlet:renderURL var="updateBookURL">
	<portlet:param name="action" value="update"/>
</portlet:renderURL>

<br/><a href="<%=updateBookURL%>">Add new Book &raquo;</a>

<%
	PortletURL listBooksURL = renderResponse.createRenderURL();
	listBooksURL.setParameter("action", "list");
	
	ResourceURL downloadURL = renderResponse.createResourceURL();
	downloadURL.setParameter("action", "download");
%>

<a href="<%=listBooksURL.toString()%>">Show all books &raquo;</a>

<a href="<%=downloadURL.toString()%>">Download &raquo;</a>

<%
	PortletURL searchBooksURL = renderResponse.createActionURL();
	searchBooksURL.setParameter("action", "searchBook");
%>
<aui:form action="<%=searchBooksURL.toString()%>" method="post">
	<aui:input name="searchTerm" label="BookTitle" />
	<aui:button type="submit" value="Search " />
</aui:form>

<%
	PortletURL createURL = renderResponse.createActionURL();
	createURL.setParameter("action", "create");
%>

<aui:form name="fm" method="POST" action="<%= createURL.toString() %>">
	<aui:input name="bookName" label="Book Name" />
	<aui:button type="submit" value="Submit"/>
</aui:form>